//
//  YSEmotion.swift
//  新浪浪
//
//  Created by mac on 16/3/10.
//  Copyright © 2016年 mac. All rights reserved.
//

import UIKit

class YSEmotion: NSObject {

    var chs: String?
    var png: String?
    var code: String?{
        didSet{
            //创建一个Scanner的实例对象
            let scan = NSScanner (string: code!)
            //定义一个可变的UInt32类型的变量
            var result:UInt32 = 0
            scan.scanHexInt(&result)
            //转换成一个Unicode
            let unicode = UnicodeScalar(result)
            //把unnicode转换成Character
            let character = Character(unicode)
            emoji = "\(character)"
        }
    }
    var path: String?
    var emoji: String?
    
    
    override init() {
        super.init()
    }
    
    init(dic:[String:NSObject]){
        super.init()
        setValuesForKeysWithDictionary(dic)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
    
    
}




















